//author:jxx
//此处是对表单的方法，组件，权限操作按钮等进行任意扩展(方法扩展可参照SellOrder.js)
import Small_operate_xaBox from '../../views/mall/Small_operate_xaBox.vue'
let extension = {
  components: {//动态扩充组件或组件路径
    //表单header、content、footer对应位置扩充的组件
    gridHeader: "",
    gridBody: Small_operate_xaBox,
    gridFooter: "",
    //弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件
    modelHeader: '',
    modelBody: "",
    modelFooter: ''
  },
  buttons: {
    view: [
      {
        name: "新建",
        icon: "md-add",
        value: "XJ",
        class: "",
        type: "error",
        index: 1, //显示的位置
        onClick: function () {
          this.$refs.gridBody.model = true;
          this.$refs.gridBody.title = "新建";
          this.$refs.gridBody.open()
        }
      },
      {
        name: "编辑",
        icon: "md-create",
        value: "BJ",
        class: "",
        type: "success",
        index: 2,
        onClick: function () {
          if (this.getSelectRows().length == 1) {
            let row = this.getSelectRows()[0];
            this.$refs.gridBody.model = true;
            this.$refs.gridBody.title = "编辑";
            this.$refs.gridBody.open(row)
          } else {
            this.$error("只能选中一行进行编辑");
          }
        }
      },
    ], box: [], detail: []
  },//扩展的按钮
  methods: {//事件扩展
    onInit () {
      this.const.PAGE = 'GetOperateManual'
      this.$store.getters.data().viewPageTest=this;
      // this.$refs.gridBody.dataList = this.$refs.table.rowData
      // console.log("%c 🇯🇵: onInit -> this.$refs.table ", "font-size:16px;background-color:#3052a7;color:white;", this.$refs)
    },
    searchAfter (result) { //查询ViewGird表数据后param查询参数,result回返查询的结果
      // this.$Notice.success({ title: this.table.cnName + ',查询结果', desc: '返回的对象：' + JSON.stringify(result) });
      result[3].operateDate = '2024-10-09'
      this.$refs.gridBody.dataList = result
      console.log("%c 🤶: searchAfter -> this.$refs.gridBody.dataList ", "font-size:16px;background-color:#f571d5;color:white;", this.$refs.gridBody.dataList)
      return true;
    },
    destroyed() {
      this.const.PAGE = 'getPageData'
    },
    rowClick({ row, column, event }) { //查询界面table点击行选中当前行
      this.$refs.table.$refs.table.toggleRowSelection(row);
      return true;
     },
  }
};
export default extension;
